3.971 \(\int \frac{(1-x)^n (1+x)^{-n}}{x^2} \, dx\)

Optimal. Leaf size=44 \[ -\frac{2 (1-x)^{n+1} (x+1)^{-n-1} \, _2F_1\left (2,n+1;n+2;\frac{1-x}{x+1}\right )}{n+1} \]

[Out]

(-2*(1 - x)^(1 + n)*(1 + x)^(-1 - n)*Hypergeometric2F1[2, 1 + n, 2 + n, (1 - x)/
(1 + x)])/(1 + n)

_______________________________________________________________________________________

Rubi [A]  time = 0.0361283, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.056 \[ -\frac{2 (1-x)^{n+1} (x+1)^{-n-1} \, _2F_1\left (2,n+1;n+2;\frac{1-x}{x+1}\right )}{n+1} \]

Antiderivative was successfully verified.

[In]  Int[(1 - x)^n/(x^2*(1 + x)^n),x]

[Out]

(-2*(1 - x)^(1 + n)*(1 + x)^(-1 - n)*Hypergeometric2F1[2, 1 + n, 2 + n, (1 - x)/
(1 + x)])/(1 + n)

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 4.20806, size = 34, normalized size = 0.77 \[ - \frac{2 \left (- x + 1\right )^{n + 1} \left (x + 1\right )^{- n - 1}{{}_{2}F_{1}\left (\begin{matrix} n + 1, 2 \\ n + 2 \end{matrix}\middle |{\frac{x - 1}{- x - 1}} \right )}}{n + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((1-x)**n/x**2/((1+x)**n),x)

[Out]

-2*(-x + 1)**(n + 1)*(x + 1)**(-n - 1)*hyper((n + 1, 2), (n + 2,), (x - 1)/(-x -
 1))/(n + 1)

_______________________________________________________________________________________

Mathematica [C]  time = 0.222281, size = 90, normalized size = 2.05 \[ -\frac{2 (1-x)^n (x+1)^{-n} F_1\left (1;-n,n;2;\frac{1}{x},-\frac{1}{x}\right )}{2 x F_1\left (1;-n,n;2;\frac{1}{x},-\frac{1}{x}\right )-n \left (F_1\left (2;1-n,n;3;\frac{1}{x},-\frac{1}{x}\right )+F_1\left (2;-n,n+1;3;\frac{1}{x},-\frac{1}{x}\right )\right )} \]

Warning: Unable to verify antiderivative.

[In]  Integrate[(1 - x)^n/(x^2*(1 + x)^n),x]

[Out]

(-2*(1 - x)^n*AppellF1[1, -n, n, 2, x^(-1), -x^(-1)])/((1 + x)^n*(2*x*AppellF1[1
, -n, n, 2, x^(-1), -x^(-1)] - n*(AppellF1[2, 1 - n, n, 3, x^(-1), -x^(-1)] + Ap
pellF1[2, -n, 1 + n, 3, x^(-1), -x^(-1)])))

_______________________________________________________________________________________

Maple [F]  time = 0.085, size = 0, normalized size = 0. \[ \int{\frac{ \left ( 1-x \right ) ^{n}}{{x}^{2} \left ( 1+x \right ) ^{n}}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((1-x)^n/x^2/((1+x)^n),x)

[Out]

int((1-x)^n/x^2/((1+x)^n),x)

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (x + 1\right )}^{-n}{\left (-x + 1\right )}^{n}}{x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((-x + 1)^n/((x + 1)^n*x^2),x, algorithm="maxima")

[Out]

integrate((x + 1)^(-n)*(-x + 1)^n/x^2, x)

_______________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \[{\rm integral}\left (\frac{{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n} x^{2}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((-x + 1)^n/((x + 1)^n*x^2),x, algorithm="fricas")

[Out]

integral((-x + 1)^n/((x + 1)^n*x^2), x)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((1-x)**n/x**2/((1+x)**n),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{{\left (-x + 1\right )}^{n}}{{\left (x + 1\right )}^{n} x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((-x + 1)^n/((x + 1)^n*x^2),x, algorithm="giac")

[Out]

integrate((-x + 1)^n/((x + 1)^n*x^2), x)